package com.example.zhang;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.os.Build;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

public class DBHelper extends SQLiteOpenHelper {
    public static final String DB_NAME = "myrate.db";
    public static final String TB_NAME = "rate";
    public static final int DB_VERSION = 1;

    public DBHelper(@Nullable Context context, String name, SQLiteDatabase.CursorFactory factory,
                    int version) {
        super(context, DB_NAME, null,DB_VERSION);
    }
    public DBHelper(Context context) {
        super(context, DB_NAME, null, DB_VERSION);
    }
    @Override
    public void onCreate(SQLiteDatabase db){
        db.execSQL("CREATE TABLE "+TB_NAME+"(ID INTEGER PRIMARY KEY AUTOINCREMENT,CURNAME TEXT,CURRATE TEXT)");
    }
    @Override
    public void onUpgrade(SQLiteDatabase db, int oldversion,int newversion){


    }
}
